{include file="../../../application/admin/view/public/head" /}
<div class="page-container p10">
    <blockquote class="layui-elem-quote layui-quote-nm">
        推送
    </blockquote>
    <form class="layui-form layui-form-pane" lay-filter="layuiform" method="post" action="">
        <div class="layui-form-item">
            <label class="layui-form-label">显示状态：</label>
            <div class="layui-input-block">
                <input name="chooseType" type="radio" id="rad-1" lay-filter="choosetype" value="0" title="全部用户" {if condition="$info['is_show'] neq 1"}checked {/if}>
                <input name="chooseType" type="radio" id="rad-2" value="1" lay-filter="choosetype" title="选择用户" {if condition="$info['is_show'] eq 1"}checked {/if}>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">通知标题：</label>
            <div class="layui-input-inline w300">
                <input type="text" class="layui-input" value="" placeholder="请输入标题" lay-verify="required" id="title" name="title">
            </div>

            <div class="layui-form-mid layui-word-aux">
                不同手机显示不同建议最多15个字，超过后的字会显示省略号
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">通知副标题：</label>
            <div class="layui-input-inline w300">
                <input type="text" class="layui-input" value="" placeholder="请输入副标题" id="subtitle" name="subtitle">
            </div>

            <div class="layui-form-mid layui-word-aux">
                仅苹果手机 可以看到  建议20个字以内，超过后的字会显示省略号
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">通知内容：</label>
            <div class="layui-input-inline w300">
                <textarea class="layui-textarea" lay-verify="required" name="content">{$info.content}</textarea>
            </div>
            <div class="layui-form-mid layui-word-aux">
                建议二十个字  安卓小米二十 超过后的字不显示   三星显示二十四 超过后的字省略号 苹果换行显示 70个字都能正常显示
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">选择视频：</label>
            <div class="layui-input-inline w200">
                <input type="hidden" name="vod_id" value="{$vodInfo.vod_id}">
                <input type="text" name="vod_name" lay-verify="required" placeholder="请选择视频" value="{$vodInfo.vod_name|default=''}" class="layui-input">
            </div>
            <div class="layui-input-inline ">
                <a href="#" class="layui-btn" >选择视频</a>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">视频源：</label>
            <div class="layui-input-inline w300">
                <select name="player" lay-verify="required">
                    <option value=""></option>
                    <option value="moren">缓存</option>
                    <option value="ckm3u8">OK资源</option>
                    <option value="dbm3u8">百度资源</option>
                    <option value="zuidam3u8">最大资源</option>
                </select>
            </div>

            <div class="layui-form-mid layui-word-aux">
                选择 要播放的视频源
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">选择剧集：</label>
            <div class="layui-input-inline w200">
                <input type="text" name="juji" lay-verify="required" placeholder="请填写剧集名称" value="" class="layui-input">

            </div>
            <div class="layui-input-inline ">
                <a href="#" class="layui-btn" >填写剧集名称</a>
            </div>
        </div>
        <div class="layui-form-item center">
            <div class="layui-input-block">
                <button type="submit" class="layui-btn" lay-submit="" lay-filter="formSubmit" data-child="true">保 存</button>
                <button class="layui-btn layui-btn-warm" type="reset">还 原</button>
            </div>
        </div>
    </form>

</div>
{include file="../../../application/admin/view/public/foot" /}
<script type="text/javascript">

    layui.use(['form','upload', 'layer'], function () {
        // 操作对象
        var form = layui.form
                , layer = layui.layer
                , upload = layui.upload
                , $ = layui.jquery;

        upload.render({
            elem: '.layui-upload'
            ,url: "{:url('upload/upload')}?flag=type"
            ,method: 'post'
            ,before: function(input) {
                layer.msg('文件上传中...', {time:3000000});
            },done: function(res, index, upload) {
                var obj = this.item;
                if (res.code == 0) {
                    layer.msg(res.msg);
                    return false;
                }
                layer.closeAll();
                var input = $(obj).parent().parent().find('.upload-input');
                if ($(obj).attr('lay-type') == 'image') {
                    input.siblings('img').attr('src', res.data.file).show();
                }
                input.val(res.data.file);

                if(res.data.thumb_class !=''){
                    $('.'+ res.data.thumb_class).val(res.data.thumb[0].file);
                }
            }
        });


        form.on('radio(choosetype)',function (ret){
            console.log(ret)
            $('input[name=chooseType][value="0"]').prop("checked",'checked')
            form.render('radio');

        })


    });

</script>

</body>
</html>